﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeardCoder.Data.Framework.NHibernate;
using NHibernate.Mapping.ByCode;

namespace EbookStore.Core.NHibernateMapping
{
    public class AuthorMap : IOverride
    {
        public void Override(ConventionModelMapper mapper)
        {
            mapper.Class<Author>(map => map.Table("lu_author"));
            mapper.Class<Author>(map => map.Id(x => x.Id, p => p.Column("author_id")));
            mapper.Class<Author>(map => map.Property(x => x.Name, p => p.Column("author_name")));
            mapper.Class<Author>(map => map.Property(x => x.Email, p => p.Column("author_email")));
            mapper.Class<Author>(map => map.Property(x => x.Address, p => p.Column("author_address")));
            mapper.Class<Author>(map => map.Property(x => x.Phone, p => p.Column("author_phone")));
            mapper.Class<Author>(map => map.Property(x => x.Biography, p => p.Column("author_biography")));
            mapper.Class<Author>(map => map.Property(x => x.Active, p => p.Column("active")));
        }
    }
}
